using System;

using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;

namespace CodeStream.Testing.WebAutomation.InternetExplorer
{
    internal class UIDevTitleBar : WinTitleBar
    {
        private readonly Lazy<WinButton> m_close;

        public UIDevTitleBar(UITestControl searchLimitContainer) :
            base(searchLimitContainer)
        {
            m_close = new Lazy<WinButton>(new Func<WinButton>(() =>
            {
                var result = new WinButton(this);
                result.SearchProperties[WinButton.PropertyNames.Name] = "Close";
                return result;
            }));
        }

        public WinButton Close
        {
            get { return m_close.Value; }
        }
    }
}
